<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
</head>
<body>
    <header class="aui-bar aui-bar-nav" id="aui-header" style="background: linear-gradient(to right,#f370af 0,#5515ee 100%);">
        <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div id="title" class="aui-title"> · · · </div>
		
				
		        <a class="aui-btn aui-pull-right" tapmode onclick="toArtical()">
            <span class="aui-iconfont aui-icon-comment" style="color:#FFF"></span>
        </a>
		
		
		 <a class="aui-btn aui-pull-right" tapmode onclick="closeWd()">
            <span class="aui-iconfont aui-icon-close" style="color:#FFF"></span>
        </a>
		
		
    </header>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
  apiready = function(){

      api.parseTapmode();
      var header = $api.byId('aui-header');
      $api.fixStatusBar(header);
      var headerPos = $api.offset(header);
      var body_h = $api.offset($api.dom('body')).h;


      var browser = api.require('webBrowser');
      browser.openView({
          url: api.pageParam.url,
          rect: {
              x: 0,
              y: headerPos.h,
              w: 'auto',
              h: 'auto'
          }
      }, function(ret, err) {
          switch (ret.state) {
              case 0:
                  break;
              case 1:
                  break;
              case 2:
		dataurl = ret.url;
        dataurl2 = dataurl;
              var url = $api.byId('newurl');
              newurl.innerHTML = '<i class="iconfont icon-svip"></i>'+ret.url;
                  break;
              case 3:
              var title = $api.byId('title');
              title.innerHTML = '<i class="iconfont icon-svip"></i>'+ret.title; 
                  break;
              case 4:
                  break;
              default:
                  break;
          }
      });

  }



  
      function closeWin(){
      var browser = api.require('webBrowser');
      browser.historyBack(
        function(ret, err) {
            if (!ret.status) {
                api.closeWin();
            }
        }
      );
    }

    function closeWd(){
      api.closeWin();
    }


    
  
    function toArtical(url){


        api.openWin({
            name: 'artical_win',
            url: 'artical_win.html', 
        });

    }
  
</script>
</html>
